Ext.ns('tlf.component');

tlf.component.YearCombo = Ext.extend(Ext.form.ComboBox, {
    store: yearsStore,
    displayField: 'year',
    valueField: 'year',
    editable: false,
    mode: 'local',
    forceSelection: true,
    triggerAction: 'all',
    width: 80,
    selectOnFocus: true,
    style: {marginLeft: '0px'}
});

tlf.component.MonthCombo = Ext.extend(Ext.form.ComboBox, {
    store: monthsStore,
    displayField: 'month',
    valueField: 'month',
    editable: false,
    mode: 'local',
    forceSelection: true,
    triggerAction: 'all',
    width: 60,
    selectOnFocus: true,
    style: {marginLeft: '0px'}
});

tlf.component.QuarterCombo = Ext.extend(Ext.form.ComboBox, {
    xtype: 'combo',
    store: quarterStore,
    displayField: 'quarter',
    valueField: 'quarter',
    editable: false,
    mode: 'local',
    forceSelection: true,
    triggerAction: 'all',
    width: 60,
    selectOnFocus: true,
    style: {marginLeft: '0px'},
    value: thisQuarter
});

tlf.component.ReportStatusCombo = Ext.extend(Ext.form.ComboBox, {
    name: 'reportStatus',
    width: 125,
    triggerAction: 'all',
    fieldLabel: '上报/观测',
    emptyText: '请选择上报状态...',
    hiddenName: 'reportStatus',
    editable: false,
    store: reportStatusStore,
    displayField: 'reportName',
    valueField: 'id',
    mode: 'local',
    //value:-1,

});

tlf.component.RangeCombo = Ext.extend(Ext.form.ComboBox, {
    name: 'range',
    fieldLabel: '口径',
    width: 125,
    triggerAction: 'all',
    emptyText: '统计口径...',
    hiddenName: 'range',
    editable: false,
    store: rangeStore,
    displayField: 'range',
    valueField: 'id',
    mode: 'local',
    //value:-1,

});

tlf.component.HaveCombo = Ext.extend(Ext.form.ComboBox,
        {
            name: 'have',
            xtype: 'combo',
            width: 125,
            triggerAction: 'all',
            fieldLabel: '有无数据',
            hiddenName: 'have',
            editable: false,
            store: haveStore,
            displayField: 'have',
            valueField: 'id',
            mode: 'local',
            value: 1
        }
);

tlf.component.PointTypeCombo = Ext.extend(Ext.form.ComboBox,
        {
            xtype: 'combo',
            width: 125,
            store: pointTypeStore,            
            displayField: 'name',
            valueField: 'id',
            hiddenName: 'pointTypeId',
            mode: 'remote',
            forceSelection: true,
            triggerAction: 'all',
            fieldLabel: '监测点类型',
            emptyText: '监测点类型...',
            selectOnFocus: true
        }
);

Ext.reg('yearcombo', tlf.component.YearCombo);
Ext.reg('monthcombo', tlf.component.MonthCombo);
Ext.reg('quartercombo', tlf.component.QuarterCombo);
Ext.reg('reportstatuscombo', tlf.component.ReportStatusCombo);
Ext.reg('rangecombo', tlf.component.RangeCombo);
Ext.reg('havecombo', tlf.component.HaveCombo);
Ext.reg('pointtypecombo', tlf.component.PointTypeCombo);
